3.2.95 \(\int \csc (c+b x) \sin (a+b x) \, dx\) [195]

Optimal. Leaf size=26 \[ x \cos (a-c)+\frac {\log (\sin (c+b x)) \sin (a-c)}{b} \]

[Out]

x*cos(a-c)+ln(sin(b*x+c))*sin(a-c)/b

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {4678, 3556, 8} \begin {gather*} \frac {\sin (a-c) \log (\sin (b x+c))}{b}+x \cos (a-c) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[c + b*x]*Sin[a + b*x],x]

[Out]

x*Cos[a - c] + (Log[Sin[c + b*x]]*Sin[a - c])/b

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4678

Int[Csc[w_]^(n_.)*Sin[v_], x_Symbol] :> Dist[Sin[v - w], Int[Cot[w]*Csc[w]^(n - 1), x], x] + Dist[Cos[v - w],
Int[Csc[w]^(n - 1), x], x] /; GtQ[n, 0] && FreeQ[v - w, x] && NeQ[w, v]

Rubi steps

\begin {align*} \int \csc (c+b x) \sin (a+b x) \, dx &=\cos (a-c) \int 1 \, dx+\sin (a-c) \int \cot (c+b x) \, dx\\ &=x \cos (a-c)+\frac {\log (\sin (c+b x)) \sin (a-c)}{b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.17, size = 26, normalized size = 1.00 \begin {gather*} x \cos (a-c)+\frac {\log (\sin (c+b x)) \sin (a-c)}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + b*x]*Sin[a + b*x],x]

[Out]

x*Cos[a - c] + (Log[Sin[c + b*x]]*Sin[a - c])/b

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(160\) vs. \(2(26)=52\).
time = 0.38, size = 161, normalized size = 6.19

method result size
risch \(x \,{\mathrm e}^{i \left (a -c \right )}-2 i \sin \left (a -c \right ) x -\frac {2 i \sin \left (a -c \right ) a}{b}+\frac {\ln \left ({\mathrm e}^{2 i \left (b x +a \right )}-{\mathrm e}^{2 i \left (a -c \right )}\right ) \sin \left (a -c \right )}{b}\) \(68\)
default \(\frac {\frac {\frac {\left (\cos \left (a \right ) \sin \left (c \right )-\sin \left (a \right ) \cos \left (c \right )\right ) \ln \left (1+\tan ^{2}\left (b x +a \right )\right )}{2}+\left (\cos \left (a \right ) \cos \left (c \right )+\sin \left (a \right ) \sin \left (c \right )\right ) \arctan \left (\tan \left (b x +a \right )\right )}{\left (\cos ^{2}\left (c \right )+\sin ^{2}\left (c \right )\right ) \left (\cos ^{2}\left (a \right )+\sin ^{2}\left (a \right )\right )}+\frac {\left (\sin \left (a \right ) \cos \left (c \right )-\cos \left (a \right ) \sin \left (c \right )\right ) \ln \left (\tan \left (b x +a \right ) \cos \left (a \right ) \cos \left (c \right )+\tan \left (b x +a \right ) \sin \left (a \right ) \sin \left (c \right )+\cos \left (a \right ) \sin \left (c \right )-\sin \left (a \right ) \cos \left (c \right )\right )}{\left (\cos ^{2}\left (a \right )\right ) \left (\cos ^{2}\left (c \right )\right )+\left (\cos ^{2}\left (c \right )\right ) \left (\sin ^{2}\left (a \right )\right )+\left (\cos ^{2}\left (a \right )\right ) \left (\sin ^{2}\left (c \right )\right )+\left (\sin ^{2}\left (a \right )\right ) \left (\sin ^{2}\left (c \right )\right )}}{b}\) \(161\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(b*x+c)*sin(b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/b*(1/(cos(c)^2+sin(c)^2)/(cos(a)^2+sin(a)^2)*(1/2*(cos(a)*sin(c)-sin(a)*cos(c))*ln(1+tan(b*x+a)^2)+(cos(a)*c
os(c)+sin(a)*sin(c))*arctan(tan(b*x+a)))+(sin(a)*cos(c)-cos(a)*sin(c))/(cos(a)^2*cos(c)^2+cos(c)^2*sin(a)^2+co
s(a)^2*sin(c)^2+sin(a)^2*sin(c)^2)*ln(tan(b*x+a)*cos(a)*cos(c)+tan(b*x+a)*sin(a)*sin(c)+cos(a)*sin(c)-sin(a)*c
os(c)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 108 vs. \(2 (26) = 52\).
time = 0.30, size = 108, normalized size = 4.15 \begin {gather*} \frac {2 \, b x \cos \left (-a + c\right ) - \log \left (\cos \left (b x\right )^{2} + 2 \, \cos \left (b x\right ) \cos \left (c\right ) + \cos \left (c\right )^{2} + \sin \left (b x\right )^{2} - 2 \, \sin \left (b x\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}\right ) \sin \left (-a + c\right ) - \log \left (\cos \left (b x\right )^{2} - 2 \, \cos \left (b x\right ) \cos \left (c\right ) + \cos \left (c\right )^{2} + \sin \left (b x\right )^{2} + 2 \, \sin \left (b x\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}\right ) \sin \left (-a + c\right )}{2 \, b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(b*x+c)*sin(b*x+a),x, algorithm="maxima")

[Out]

1/2*(2*b*x*cos(-a + c) - log(cos(b*x)^2 + 2*cos(b*x)*cos(c) + cos(c)^2 + sin(b*x)^2 - 2*sin(b*x)*sin(c) + sin(
c)^2)*sin(-a + c) - log(cos(b*x)^2 - 2*cos(b*x)*cos(c) + cos(c)^2 + sin(b*x)^2 + 2*sin(b*x)*sin(c) + sin(c)^2)
*sin(-a + c))/b

________________________________________________________________________________________

Fricas [A]
time = 2.85, size = 31, normalized size = 1.19 \begin {gather*} \frac {b x \cos \left (-a + c\right ) - \log \left (\frac {1}{2} \, \sin \left (b x + c\right )\right ) \sin \left (-a + c\right )}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(b*x+c)*sin(b*x+a),x, algorithm="fricas")

[Out]

(b*x*cos(-a + c) - log(1/2*sin(b*x + c))*sin(-a + c))/b

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 133 vs. \(2 (20) = 40\).
time = 4.10, size = 335, normalized size = 12.88 \begin {gather*} \left (\begin {cases} 0 & \text {for}\: b = 0 \wedge \left (b = 0 \vee c = 0\right ) \\x & \text {for}\: c = 0 \\- \frac {b x \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {b x}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {2 \log {\left (\tan {\left (\frac {c}{2} \right )} + \tan {\left (\frac {b x}{2} \right )} \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {2 \log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {1}{\tan {\left (\frac {c}{2} \right )}} \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {2 \log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} & \text {otherwise} \end {cases}\right ) \cos {\left (a \right )} + \left (\begin {cases} \tilde {\infty } x & \text {for}\: b = 0 \wedge c = 0 \\\frac {x}{\sin {\left (c \right )}} & \text {for}\: b = 0 \\\frac {\log {\left (\sin {\left (b x \right )} \right )}}{b} & \text {for}\: c = 0 \\\frac {2 b x \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan {\left (\frac {c}{2} \right )} + \tan {\left (\frac {b x}{2} \right )} \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan {\left (\frac {c}{2} \right )} + \tan {\left (\frac {b x}{2} \right )} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {1}{\tan {\left (\frac {c}{2} \right )}} \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {1}{\tan {\left (\frac {c}{2} \right )}} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} & \text {otherwise} \end {cases}\right ) \sin {\left (a \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(b*x+c)*sin(b*x+a),x)

[Out]

Piecewise((0, Eq(b, 0) & (Eq(b, 0) | Eq(c, 0))), (x, Eq(c, 0)), (-b*x*tan(c/2)**2/(b*tan(c/2)**2 + b) + b*x/(b
*tan(c/2)**2 + b) - 2*log(tan(c/2) + tan(b*x/2))*tan(c/2)/(b*tan(c/2)**2 + b) - 2*log(tan(b*x/2) - 1/tan(c/2))
*tan(c/2)/(b*tan(c/2)**2 + b) + 2*log(tan(b*x/2)**2 + 1)*tan(c/2)/(b*tan(c/2)**2 + b), True))*cos(a) + Piecewi
se((zoo*x, Eq(b, 0) & Eq(c, 0)), (x/sin(c), Eq(b, 0)), (log(sin(b*x))/b, Eq(c, 0)), (2*b*x*tan(c/2)/(b*tan(c/2
)**2 + b) - log(tan(c/2) + tan(b*x/2))*tan(c/2)**2/(b*tan(c/2)**2 + b) + log(tan(c/2) + tan(b*x/2))/(b*tan(c/2
)**2 + b) - log(tan(b*x/2) - 1/tan(c/2))*tan(c/2)**2/(b*tan(c/2)**2 + b) + log(tan(b*x/2) - 1/tan(c/2))/(b*tan
(c/2)**2 + b) + log(tan(b*x/2)**2 + 1)*tan(c/2)**2/(b*tan(c/2)**2 + b) - log(tan(b*x/2)**2 + 1)/(b*tan(c/2)**2
 + b), True))*sin(a)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 236 vs. \(2 (26) = 52\).
time = 0.41, size = 236, normalized size = 9.08 \begin {gather*} \frac {\frac {{\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, a\right )^{2} + 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, c\right )^{2} + 1\right )} {\left (b x + c\right )}}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} + \tan \left (\frac {1}{2} \, c\right )^{2} + 1} - \frac {2 \, {\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right ) - \tan \left (\frac {1}{2} \, c\right )\right )} \log \left (\tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, c\right )^{2} + 1\right )}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} + \tan \left (\frac {1}{2} \, c\right )^{2} + 1} + \frac {2 \, {\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right ) - \tan \left (\frac {1}{2} \, c\right )\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, b x + \frac {1}{2} \, c\right ) \right |}\right )}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} + \tan \left (\frac {1}{2} \, c\right )^{2} + 1}}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(b*x+c)*sin(b*x+a),x, algorithm="giac")

[Out]

((tan(1/2*a)^2*tan(1/2*c)^2 - tan(1/2*a)^2 + 4*tan(1/2*a)*tan(1/2*c) - tan(1/2*c)^2 + 1)*(b*x + c)/(tan(1/2*a)
^2*tan(1/2*c)^2 + tan(1/2*a)^2 + tan(1/2*c)^2 + 1) - 2*(tan(1/2*a)^2*tan(1/2*c) - tan(1/2*a)*tan(1/2*c)^2 + ta
n(1/2*a) - tan(1/2*c))*log(tan(1/2*b*x + 1/2*c)^2 + 1)/(tan(1/2*a)^2*tan(1/2*c)^2 + tan(1/2*a)^2 + tan(1/2*c)^
2 + 1) + 2*(tan(1/2*a)^2*tan(1/2*c) - tan(1/2*a)*tan(1/2*c)^2 + tan(1/2*a) - tan(1/2*c))*log(abs(tan(1/2*b*x +
 1/2*c)))/(tan(1/2*a)^2*tan(1/2*c)^2 + tan(1/2*a)^2 + tan(1/2*c)^2 + 1))/b

________________________________________________________________________________________

Mupad [B]
time = 0.87, size = 111, normalized size = 4.27 \begin {gather*} x\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}}{2}-\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}}{2}\right )+x\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}}{2}\right )+\frac {\ln \left (-{\mathrm {e}}^{a\,2{}\mathrm {i}-c\,2{}\mathrm {i}}+{\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\right )\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(a + b*x)/sin(c + b*x),x)

[Out]

x*(exp(c*1i - a*1i)/2 - exp(a*1i - c*1i)/2) + x*(exp(c*1i - a*1i)/2 + exp(a*1i - c*1i)/2) + (log(exp(a*2i + b*
x*2i) - exp(a*2i - c*2i))*((exp(c*1i - a*1i)*1i)/2 - (exp(a*1i - c*1i)*1i)/2))/b

________________________________________________________________________________________